1. Field of the Invention
The present invention relates to inputting and outputting data between nodes or between a node and a peripheral device in a computer system in which a plurality of nodes are interconnected through a network or in a computer system in which nodes are connected to peripheral devices.
2. Description of the Related Art
Recently, there has arisen a strong demand to develop high-speed and high-reliability data input/output processes performed in a computer system through a network in communicating with CPUs and peripherals. Therefore, it has become more and more important to realize a high-performance and high-reliability data input/output system.
In the conventional data input/output system for synchronously performing a data input/output process in a computer system, a CPU is occupied by a series of operations. In place of the conventional system, there have been an increasing number of asynchronous data input/output systems capable of asynchronously issuing requests to input and output data.
In the asynchronous data input/output processes in the asynchronous system, a thread of a device driver for performing an input/output process for each device is activated in a kernel space by a thread in a user process issuing a predetermined input/output function. Then, the thread in the kernel space actually performs the input/output process requested by the thread of the user process. A thread refers to a process unit which obtains a CPU time.
When a process of inputting and outputting data is performed in an asynchronous system in a computer system, a data area to and from which data is input and output has to be reserved and fixed not to reassigned to another process by virtual storage control, etc. The process of fixing the data area should be performed after a serializing process. Therefore, a thread for the process occupies a long CPU time.
In addition, when data is input and output with the data communicated in a computer system, a thread in a user process is temporarily transferred to a kernel space for synchronization in the kernel space by issuing a system call when it is necessary to be synchronous with another thread in the kernel space.
When it is necessary for a thread in a user space to be synchronous with a thread in a kernel space, the thread in the user space issues a system call for transition to the kernel space and for synchronization with the thread in the kernel space. However, a system call requires a larger overhead than other thread process. Therefore, the transition to the kernel space using the system call is necessary, but causes a delay of the process.
Furthermore, to establish data communications in a computer system, it is common to enter a network adaptor as one device in a system, and explicitly declare the device to perform various processes on a user side.
Conventionally, driver software of each adapter such as a network adapter, etc. exists as each device file. Therefore, when a user process uses an adapter, it is to explicitly designate an adapter to be used. Accordingly, any of a plurality of existing adapters becomes faulty, the user process directly detects the fault. Therefore, to satisfy the requirements for high-reliability, it has been necessary to take action against the fault on the user process side.
In addition, in a computer system which assigns a right number to each device to identify the device using the assigned number, when there are a plurality of identical devices in the system, a device identification number is normally assigned to each device.
At this time, when there are a plurality of processes which have called devices having the same device numbers in the computer system, and if each of these processes issues an end message, only the last issue of the end message is provided for a device driver. Therefore, in a device driver requiring resource management for each process, resources cannot be collected for each process.
Furthermore, a cleanup (collecting) process is performed by each resource as a process to be performed when an abnormal process occurs when data communications are established in a computer system. In the cleanup process performed by each resource, there has been the problem that the process cannot be correctly performed especially when the communications memory management relating to an asynchronous data input/output process system is included in the system as a resource, or when resources are related to each other.
Although a process generates a child process, the resource in a driver is still shared among processes. If one process notifies the driver of, for example, the end of using an adapter, there arises the problem that a related resource in the driver can be released although there are processes still using the adapter.
To solve the above described problems, the present invention aims at providing a high-efficiency, performance, and reliability data processing apparatus and method capable of inputting and outputting data, and a storage medium storing a program directing an information processing apparatus.
The present invention also aims at setting synchronization without exclusive control between a user space and a kernel space in a data input/output process, and efficiently inputting and outputting data with a small overhead for a system call.
Furthermore, the present invention aims at efficiently inputting and outputting data with a thread for performing a process of fixing a data area prevented from occupying the CPU for a long time.
Additionally, the present invention aims at performing an input/output process, especially in a system in which there are a plurality of identical adapters, without having a user process be aware that there are the plurality of adapters, and also aims at collecting resources held by a process without problems even when the process is in an abnormal state.
The data processing apparatus according to the present invention is based on the function of asynchronously processing in a kernel space an input/output request from a process in a user space. The apparatus includes an input/output request holding unit, and a request list adding unit.
The input/output request holding unit holds an input/output request from a user space to a kernel space as a queue of a list structure.
When a new input/output request is issued in a process in a user space, the request list adding unit adds the input/output request as a list element to the queue.
Upon receipt of an input/output request from a user in a kernel space, an input/output request acceptance unit accepts the input/output request from the user process. An input/output request processing thread generation unit generates a thread for processing the input/output request accepted by the input/output request acceptance unit as a plurality of divided threads.
For example, the unit generates the first thread for processing the input/output request, and separately the second thread whose completion time cannot be predicted from the first thread.
When the data processing apparatus has a plurality of identical adapters, input/output requests issued to the plurality of adapters are accepted in one entry, and one of the plurality of adapters is assigned to the input/output requests.
The present invention can realize a high-performance and high reliability data input/output process.
When the above described processes are realized using a program in an information processing apparatus, the program can be stored in an appropriate storage medium which can be read by the information processing apparatus such as portable medium memory, semiconductor memory, a hard disk, etc.